package com.tiancheng.trade.authserver.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;

import java.util.Objects;

@TableName("auth_user_map_role")
@Getter
@Setter
public class AuthUserMapRole extends BaseModel {
    private Long userId;
    private Long roleId;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof AuthUserMapRole)) {
            return false;
        }
        AuthUserMapRole that = (AuthUserMapRole) o;
        if (Objects.equals(this.getId(), that.getId())) {
            return true;
        } else {
            return Objects.equals(this.getUserId(), that.getUserId()) &&
                    Objects.equals(this.getRoleId(), that.getRoleId());
        }
    }

    @Override
    public int hashCode() {
        return Objects.hash(this.getUserId(), this.getRoleId());
    }
}
